package o;

import android.text.TextUtils;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.huawei.appgallery.downloadengine.api.SessionDownloadTask;
import com.huawei.appgallery.downloadengine.api.SplitTask;
import java.io.File;
import java.util.List;

public class dkb {

    public interface d {
        void ˋ(@Nullable SessionDownloadTask sessionDownloadTask);
    }

    public static long ˏ(@NonNull SessionDownloadTask sessionDownloadTask) {
        return sessionDownloadTask.ˊˋ();
    }

    public static void ˎ(SessionDownloadTask sessionDownloadTask) {
        if (sessionDownloadTask != null) {
            List<SplitTask> ᐝˊ = sessionDownloadTask.ᐝˊ();
            if (!CollectCheck.isEmpty((List) ᐝˊ)) {
                for (SplitTask splitTask : ᐝˊ) {
                    if (!(TextUtils.isEmpty(splitTask.ˊˊ()) || new File(splitTask.ˊˊ()).delete())) {
                        Logger.e("DownloadHelper", "file delete failed!");
                    }
                }
            }
        }
    }

    public static boolean ˏ(int i) {
        switch (i) {
            case 0:
            case 1:
            case 2:
            case 7:
                return false;
            default:
                return true;
        }
    }
}
